<html class="ks-webkit537 ks-webkit ks-chrome42 ks-chrome">
	<head>
        <meta charset="gbk">
        <meta name="keywords" content="{$site_seo_keywords}">
        <meta name="description" content="{$site_seo_description}" />
        <title>{$lession['sc_name']}</title>
		<link href="__PUBLIC__/js/artDialog_v6/ui_dialog.css" rel="stylesheet" />
		<link rel="stylesheet" media="screen" href="__PUBLIC__/simplebootx/public/css/play.css" />
		<script src="__PUBLIC__/js/jquery.js"></script>
		<script src="__PUBLIC__/js/artDialog_v6/dialogmin.js"></script>
	</head>
	<body>
		
		<div class="tx-main" style="overflow:hidden;">	
			<if condition="sp_is_mobile()">
				<div class="alert alert-red">
				<span class="close rotate-hover"></span><strong>操作失败</strong>
				<p>请在电脑上进行视频课程学习</p>			
				</div>
			</if>
			<div class="tx-banner">
				<div class="tx-banner-left">
					<a href="{:u('course/Course/courseinfo',array('id'=>$lession['cs_id']))}" id="J_goBack">
						<img src="__PUBLIC__/simplebootx/public/images/play_1.png" alt="">
					</a>
				</div>
			   <div class="tx-banner-title" id="J_CourseTitle">{$lession['csname']}</div>
			   <!-- <div class="tx-banner-logo"><a href="#"><img src="__PUBLIC__/simplebootx/public/images/logo.png" alt=""></a></div> -->
			</div>
			<div class="tx-main-inner" id="J_Content">
				<div class="tx-player-wrapper ks-player" style="display: block;  transition: 1s;">
					<div class="hd"></div>
					<div class="bd">
						<div class="container" id="J_Container"  style="transition: 1s;-webkit-transition: 1s;">
						    <input type="hidden" id="cs_id" value="{$lession['cs_id']}"></input>
							<input type="hidden" id="sc_id" value="{$lession['id']}"></input>
							<if condition="!$isover">
							    <if condition="$lession['video_type']==1">
								    <if condition="$lession['videoid']">
										<div class="player" id="J_Player" style="transition: 1s;-webkit-transition:1s;">
											<embed id="player_iframe" style="transition: 1s;-webkit-transition:1s;" src='http://www.wsview.com/yzplayerAction!play2.action?autoPlay=false&userVideoID={$lession['videoid']}' frameBorder='0'></embed>
										</div>
										<button class="button button-over">我学完了</button>
									<else />
									    <div class="player" id="J_Player" style="transition: 1s;-webkit-transition:1s;"></div>
										
									    <script type="text/javascript" src="__PUBLIC__/simplebootx/public/ckplayer/ckplayer.js" charset="gb2312"></script>
										<script type="text/javascript">
											var nowD=document.getElementById("sc_id").value;
											function loadedHandler(){
												if( CKobject.getObjectById('ckplayer_a1').getType()){
													CKobject.getObjectById('ckplayer_a1').addListener('play',playHandler);
													CKobject.getObjectById('ckplayer_a1').addListener('pause',pauseHandler);
												}
												else{
													CKobject.getObjectById('ckplayer_a1').addListener('play','playHandler');
													CKobject.getObjectById('ckplayer_a1').addListener('pause','pauseHandler');
												}
											}
											function playerstop(){
												var sid=document.getElementById("sc_id").value;
												var cid=document.getElementById("cs_id").value;
												$.ajax({ url:'{:u('Course/Course/studied')}', 
													 type:"post", data:{'sc_id':sid,'cs_id':cid}, 
													 dataType:'json', 
													 success:function(data){
													   }
													}
												  );
												$('#J_Player').hide() ;
												$('#J_PlayOver').show() ;
																				
											}
											
											function playvideo(n){
												nowD=n;
												$.ajax({ url:'{:u('Course/Course/chekbuy')}', 
													 type:"post", 
													 data:{'id':nowD}, 
													 dataType:'json', 
													 success:function(res){
													    if(res.isbuy==1 || res.isfree==1 || res.isteacher==1){ 
															var flashvars={
															f:'__ROOT__/index.php?g=course&m=Course&a=video&sid=[$pat]',
															c:0,
															p:1,
															s:1,
															a:nowD,
															e:0,
															loaded:'loadedHandler'
															};
															var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'};
															 CKobject.embed('__PUBLIC__/simplebootx/public/ckplayer/ckplayer.swf','J_Player','ckplayer_a1','100%','100%',false,flashvars,params);
														} 
														else{ 
														  $("#J_Player").hide();
														  $("#J_nobuy").show();
														} 
													}
												});
											}
											playvideo(nowD);
										</script>
									</if>
								<else />
									<div class="player" id="J_Player" style="transition: 1s;-webkit-transition:1s;">
									     <embed src="{$lession[yun_url]}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="opaque" height="100%" width="100%" ></embed>
									</div>
								</if>
									
							<else />
							    <div class="poster" id="J_Poster" style="transition: 1s;-webkit-transition: 1s; display:none;">
										<div class="poster-wrapper-outer">
											<div class="poster-wrapper-inner">
												<div class="icon"></div>
												<div class="detail-wrapper">
													<p>亲~课程已过期，无法继续学习！</p>
												</div>
											</div>
										</div>
								</div>   
							</if>
							<div class="poster" id="J_PlayOver" style="transition: 1s;-webkit-transition: 1s; display:none;">
								<div class="poster-wrapper-outer">
									<div class="poster-wrapper-inner">
										<div class="icon"></div>
										<div class="detail-wrapper">
											<p>恭喜你，已经学完本节课程，你可以再回顾一下或者继续学习！</p>
										</div>
									</div>
								</div>
							</div>
							<div class="poster" id="J_nobuy" style="transition: 1s;-webkit-transition: 1s; display:none;">
								<div class="poster-wrapper-outer">
									<div class="poster-wrapper-inner">
										<div class="icon"></div>
										<div class="detail-wrapper">
											<p>亲！您还没购买此课程，请购买后再来观看学习！</p>
										</div>
									</div>
								</div>
							</div>   							
						</div>
					</div>
				</div>

				<div class="tx-sidebar-wrapper ks-sidebar" id="J_SideBar"  style="transition: 1s;">
					<div id="J_tab">
						<div class="tab-content" >
							<div class="tab-pannel">
								<div class="tx-info">
									<a class="link" href="">
										<div class="img-wrapper-outer">
											<div class="img-wrapper">
											    <if condition="empty($lession['pic'])">
												   <img class="img" src="__PUBLIC__/images/course.png" alt="{$lession.cs_name}">
												 <else /> 
												   <img class="img" src="{$lession.pic}" alt="{$lession.cs_name}">
												 </if> 
											</div>
										</div>
										<div class="info-wrapper">
											<h3>{$lession['csname']}</h3>
											<span></span>
										</div>
									</a>
								</div>
								<div class="tx-outline ks-outline" data-guid="2" data-initialized="true" style="height: 465px;">
									<div class="outline-inner" id="J_OutlineInner">
										<div class="chapter J_Chapter">
											<h4>章节<span class="num">1</span><span class="name">{$lession['csname']}</span></h4>
											<input type="hidden" id="count" value="{$count}">
											<ul>  
												<volist name="sc_list" id="sub" key="k" >
													<if condition="$cid eq $sub['id']">
													 <a href="{:u('course/Course/study',array('id'=>$sub['id']))}" title="{$sub['sc_name']} " style='text-decoration:none;color:#333;'>
													  <li class="course J_Course head active">
													<else/>
													  <a href="{:u('course/Course/study',array('id'=>$sub['id']))}" title="{$sub['sc_name']}" style='text-decoration:none;color:#333;'>
													  <li class="course J_Course head" id="{$sub['id']}" onmousemove="addhover(this.id)" onmouseout="delhover(this.id)" >
													</if>
														<div class="info">
															<p>课时</p>
															<p class="time">{$sub['sc_time']}</p>
														</div>
														<div class="detail">
															<p>{$sub['sc_name']}</p>
															<div class="resources-wrapper">
																<span class="resources video">
																	<span class="icon"></span>点播
																</span>
															</div>
														</div>
														<if condition="(isstudy($sub['id']) eq 1) or ($cid eq $sub['id'])">
															<span class="progress done"></span>
														<else/>
															<span class="progress"></span>
														</if>
														
													</li>
													</a>
												</volist>		
											</ul> 
										</div>
										<div class="bar"></div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="action J_Fold unfold">
						<span class="tx-learn-iconfont unfold-icon"></span>
						<span class="tx-learn-iconfont fold-icon"></span>
					</div>
				</div>
			</div>
		</div>
	
	</body>
<script type="text/javascript">
   $(".button-over").click(function(){ 
		var sid=document.getElementById("sc_id").value;
		var cid=document.getElementById("cs_id").value;
		var d = dialog({
			title: '正在提交...',
			content: '恭喜你，已经学完本节课程！'
			
		});
		d.width(300)
		d.showModal();
		setTimeout(function () {
			d.close().remove();
		  }, 2000);
		$.ajax({ url:'{:u('Course/Course/studied')}',
			 type:"post", data:{'sc_id':sid,'cs_id':cid}, 
			 dataType:'json', 
			 success:function(data){
			   }
			}
		  );
	}); 
</script>	
<script type="text/javascript">
    
	$(function(){
	    var count=$("#count").val();
	    var width = $(window).width()+17;
        var height = $(window).height();
		$(".bar").css("height",20+count*70-35);
		$(".tx-main").css("width",width);
		$(".tx-main").css("height",height);
		$(".J_Container").css("height",height-130);
		$(".J_Container").css("width",width-320);
		$(".player").css("height",height-160);
		$(".player").css("width",width-340);
		$("#player_iframe").css("height",height-160);
		$("#player_iframe").css("width",width-340);
		$("#J_tab").css("height",height-130);
		$(".poster").css("height",height-160);
		$(".poster").css("width",width-340);
		$(".ks-player").css("width","78%");
	    $(".ks-sidebar").css("width","22%");
		
		var onf=true;		
		$('.J_Fold').click(function(){
			if(onf){
				$(".ks-player").css("width",width);
				$(".ks-sidebar").css("width",0);
				$(".player").css("width",width-40);
	    	    $("#player_iframe").css("width",width-40);
				$(".poster").css("width",width-40);
				$(".J_Fold").removeClass("unfold");
				onf=false;
			}else{
				$(".ks-player").css("width",width-300);
				$(".player").css("width",width-340);
				$("#player_iframe").css("width",width-340);
				$(".poster").css("width",width-340);
				$(".ks-sidebar").css("width",300);
				$(".J_Fold").addClass("unfold");
			onf=true;
			}
		});
	})
	function addhover(id){
      $("#"+id).addClass('hover');
	  $("#"+id +"a").css('color','red');
	}
	function  delhover(id){
	  $("#"+id).removeClass('hover');
	} 
</script>	
</html>